package org.apache.ocean;

import org.apache.lucene.util.PriorityQueue;

/**
 *
 * @author jasonr
 */
public class CHitQueue extends PriorityQueue {
  public CHitQueue(int size) {
    initialize(size);
  }

  protected final boolean lessThan(Object a, Object b) {
    CScoreDoc hitA = (CScoreDoc)a;
    CScoreDoc hitB = (CScoreDoc)b;
    if (hitA.score == hitB.score)
      return hitA.doc > hitB.doc; 
    else
      return hitA.score < hitB.score;
  }
}